<template>
  <el-container style="height: 900px; border: 1px solid #eee">
    <el-aside width="201px">
      <el-col :span="12">
        <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            style="width: 200px"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>功能列表</span>
            </template>
            <el-menu-item index="1-1">
              <router-link to="/index/user" style="text-decoration-line: none;">用户管理</router-link>
            </el-menu-item>
            <el-menu-item index="1-2">
              <router-link to="/index/device" style="text-decoration-line: none">设备管理</router-link>
            </el-menu-item>
          </el-submenu>
        </el-menu>
      </el-col>
    </el-aside>
    <el-container>
      <el-header style="background: cadetblue">
        <el-button type="info" plain style="margin-left: 90%" v-on:click="exit">退出登录</el-button>
      </el-header>
      <el-main>
        <!--    子页面-->
        <router-view/>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  data() {
    return {}
  },
  methods: {
    exit() {
      sessionStorage.removeItem("token")
      this.$router.push("/login")
    }
  },
  mounted() {

  }
}
</script>